{{ include("common/header.html")}}
<div class="admin">
    {{ include("common/moduleNav.html")}}
    <script src="{{_G['APP']}}/resource/js/jquery-1.4.2.min.js"></script>
    <link rel="stylesheet" href="{{_G['APP']}}/resource/css/global.css">

    <div class="aright">
        <div class="aright_1">

            <form class="layui-form" action="{{ G.url('admin/modules/modulesList')}}" method="get" lay-filter="component-form-group">
                <input type="hidden" name="m" value="admin"/>
                <input type="hidden" name="c" value="modules"/>
                <input type="hidden" name="a" value="modulesList"/>
                <div class="layui-form-item">
                    <label class="layui-form-label">&nbsp;</label>
                    <div class="layui-input-inline" style="width:40%;">
                        <input type="input" value="{{_GPC['name']}}" name="name" lay-verify="" placeholder="请输入插件名" class="layui-input">
                    </div>
                    <button class="layui-btn" type="submit"><i class="layui-icon" style="font-size: 25px; ">&#xe615;</i>  搜索插件</button> &nbsp;&nbsp;<a href="http://s.calfbb.com/" target="_blank">去官网下载扩展?</a>
                </div>


                <div class="fly-main" style="overflow: hidden;">

                    <ul class="fly-case-list">

                        {% for data in list %}
                        <li data-id="586">
                            <a class="fly-case-img"  rel="nofollow">
                                <img src="/{{route.DEFAULT_ADDONS}}/{{data.dir_name}}/{{data.logo}}" alt="{{data.name}}" />
                                <cite  dir-name="{{data.dir_name}}" class="layui-btn layui-btn-primary layui-btn-small click">进入</cite>
                            </a>
                            <h2>
                                <a rel="nofollow">{{data.name}}</a>
                            </h2>
                            <p class="fly-case-desc">
                                {{data.descr}}
                            </p>
                            <div class="fly-case-info">

                                <p>安装时间：{{data.install_time|date("Y-m-d H:i")}}</p>
                                <p>作者：{{data.author}}</p>
                                <p>版本：{{data.version}}</p>
                                <P>操作： <a style="color:#01AAED;" href="{{ G.url('admin/modules/uninstallModules', {dir_name:data.dir_name, })}}">卸载</a></P>
                            </div>
                        </li>
                        {% endfor %}



                    </ul>
                    <div style="text-align: center;">
                        <div id="pages"></div>
                    </div>
                </div>



            </form>
        </div>
    </div>
</div>


<script>
    /**
     * 构造分页功能
     */
    layui.use('laypage', function () {
        var laypage = layui.laypage;

        //完整功能
        laypage.render({
            elem: 'pages',
            count: "{{pagination.total}}",
            limit: "{{pagination.page_size}}",
            curr: "{{pagination.current_page}}",
            layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
            jump: function (obj, first) {
                var url = "{{ G.url('admin/modules/modulesList',{'current_page':'currs','page_size':'limit'})}}";
                /**
                 * 替换处理
                 * @type {string}
                 */
                url = url.replace("currs", obj.curr);
                url = url.replace("limit", obj.limit);

                //首次不执行
                if (!first) window.location.href = escapeUrl(url);//转义amp字符

            }
        });

    });

    $(".click").click(function () {
        var dir_name=$(this).attr('dir-name');

        var url = "{{ G.url('modules/admin/index')}}";
        /**
         * 替换处理
         * @type {string}
         */
        url = url.replace("modules", dir_name);
        //首次不执行
       window.location.href = escapeUrl(url);//转义amp字符


    });




</script>
{{ include("common/footer.html")}}